﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using ComputerStoreManager.ViewModel;

namespace ComputerStoreManager.View
{
    /// <summary>
    /// Interaction logic for CustomerControl.xaml
    /// </summary>
    public delegate void OnCusTomerControlAddCustomerEventHandler();
    public delegate void OnCustomerControlViewCustomerEventHandler();
    public partial class CustomerControl : UserControl
    {
        public event OnCusTomerControlAddCustomerEventHandler OnAddCustomerClicked;
        public event OnCustomerControlViewCustomerEventHandler OnViewCustomerClicked;

        public CustomerControl()
        {
            InitializeComponent();
            this.DataContext = new CustomerControlViewModel();
        }

        private void btnAddCustomer_Click(object sender, RoutedEventArgs e)
        {
            if (OnAddCustomerClicked != null)
            {
                OnAddCustomerClicked();
            }
        }

        private void btnViewCustomer_Click(object sender, RoutedEventArgs e)
        {
            if (OnViewCustomerClicked != null)
            {
                OnViewCustomerClicked();
            }
        }
    }
}
